package cn.tju.leavingsystem.service;

import cn.tju.leavingsystem.entity.LeavingApplication;

import java.util.List;

public interface LeavingApplicationService {
    /**
     * 得到库中所有的请假单
     * @return 请假单列表
     */
    List<LeavingApplication> getLeavingAppliactionList();

    /**
     * 通过id查找请假单
     * @param applicationId
     * 请假单id
     * @return 请假单
     */
    LeavingApplication getLeavingApplicationById(int applicationId);

    /**
     * 通过员工的id查找请假单
     * @param staffId
     * 员工id
     * @return 请假单
     */
    List<LeavingApplication> getLeavingApplicationByStaffId(int staffId);

    /**
     * 填写申请单
     * @param leavingApplication
     * 申请单
     * @return 是否插入成功
     */
    boolean addLeavingApplication(LeavingApplication leavingApplication);

    /**
     * 修改申请单
     * @param leavingApplication
     * 申请单
     * @return 是否修改成功
     */
    boolean modifyLeavingApplication(LeavingApplication leavingApplication);

    /**
     * 根据id删除申请单
     * @param applicationId
     * 申请单id
     * @return 是否删除成功
     */
    boolean removeLeavingApplication(int applicationId);
}
